﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Weixin.Web.ajax
{
    /// <summary>
    /// jsapi 的摘要说明
    /// </summary>
    public class jsapi : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string url = context.Request.Params["url"];
            WX wx = new WX();
            string[] arr = wx.GetJSSDK(url);
            context.Response.Write("{\"noncestr\":\"" + arr[0] + "\",\"jsapi_ticket\":\"" + arr[1] + "\",\"timestamp\":\"" + arr[2] + "\",\"signature\":\"" + arr[3] + "\"}");
            context.Response.End();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}